/***********************************************************************
 *
 * MODULE NAME:    platform_config.h
 * DESCRIPTION:    Host Side Stack Win32 specific configuration options 
 * AUTHOR:         Martin Mellody
 *
 * SOURCE CONTROL: $Id: platform_config.h,v 1.1 2008/01/03 06:55:12 tianwq Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2000-2002 RDA Microelectronics.
 *     All rights reserved.
 *
 ***********************************************************************/

#ifndef PLATFORM_CONFIG_H
#define PLATFORM_CONFIG_H

/********************************** Base Types ***************************************************/
typedef unsigned char   u_int8;       /* unsigned integer,  8 bits long */
typedef unsigned short  u_int16;     /* unsigned integer, 16 bits long */
typedef unsigned int    u_int32;       /* unsigned integer, 32 bits long */
typedef unsigned char boolean;   /* boolean, true=1, false=0 */

typedef signed char     s_int8;         /* unsigned integer,  8 bits long */
typedef signed short    s_int16;       /* unsigned integer,  8 bits long */
typedef signed long     s_int32;        /* unsigned integer,  8 bits long */

typedef unsigned int    u_int;

/********************************** Host Stacks ***************************************************/
/* All configurable host stack parameters should be set in this file, with a descriptive comment */
/* All preprocessor symbols should be defined as 1 or 0, to include or not include the feature */
/* All timer values are in tenths of a second, i.e. 400 - 40 seconds */
/****************** Scheduler ***************/
#define SCHEDULER_PRESENT               1
/* timeout wait for complele event of first hci_reset */
#define BOOTUP_HC_RESPONSE_TIMEOUT      30

/* max host timers */
#define MAX_HOST_TIMERS		10    

/* max host buffer count */
#define MAX_HOST_BUFF_COUNT		10

/* size of host message queue */
#define MAX_HOST_MESSAGES		20    
#define MAX_HOST_MESSAGES_LENGTH    1024

/******************* Manager ***************/
#define MANAGER_PRESENT                 1

/* max support device/connects */
#define MGR_MAXNUM_SCOHANDLES          1
#define MGR_MAXNUM_ACTIVE_ACLS        6
#define MGR_MAXNUM_DEVICE_LIST        50

/* max support service number */
#define MAX_SERVICE_NUM         10

/* Device Mode */
#define RDABT_SNIFF_SUPPORTED             1
#define RDABT_PARK_SUPPORTED              0

/* suport multi connections or not */
#define MGR_MULTI_CONNECTION        0

/* class of local device */
#define MGR_DEVICE_CLASS            0x200404    //for headset //0x5a0204

/* enable host security */
#define HOST_SECURITY	                1

/* packet types for SCO/eSCO link 
avilable value of following bit or:
#define HCI_SYN_HV1         0x0001
#define HCI_SYN_HV2         0x0002
#define HCI_SYN_HV3         0x0004
#define HCI_SYN_EV3         0x0008
#define HCI_SYN_EV4         0x0010
#define HCI_SYN_EV5         0x0020
#define HCI_SYN__2EV3          0x0040
#define HCI_SYN__3EV3          0x0080
#define HCI_SYN__2EV5          0x0100
#define HCI_SYN__3EV5          0x0200
*/
#define RDABT_SCO_TYPES             (0x04)

/* local io capability for simple security pairing, 
     for mobile, select MGR_IOCAP_DISPLAY_YESNO or  MGR_IOCAP_KEYBOARD_ONLY 
     for other device, MGR_IOCAP_DISPLAY_ONLY and MGR_IOCAP_NOINPUT_NOOUTPUT can be selected */
#define RDABT_LOCAL_IOCAP   MGR_IOCAP_NOINPUT_NOOUTPUT

/* The local and remote names are truncated to the defines below - see GAP spec. */
#define MGR_MAX_REMOTE_NAME_LEN         30
#define MGR_MAX_LOCAL_NAME_LEN          48

#define MGR_SNIFF_TIMEOUT                    30
#define MGR_SNIFF_INTERVAL                   0x320

/******************* HCI ******************/
#define HCI_PRESENT                         0 

/* Stack/HCI - Buffer limits */
#define RDABT_MAX_ACL_QUEUES_SIZE              (RDABT_HCI_MAX_ACL_SIZE*RDABT_HCI_MAX_ACL_NUM*2)

/* HCI - HC to Host Flow Control */
#define RDABT_HCI_FLOWCTRL_SUPPORT                  1
#define RDABT_HCI_FLOWCTRL_REPORT_TIMEOUT           3 
#define RDABT_HCI_FLOWCTRL_REPORT_THRESHOLD         5
#define RDABT_HCI_MAX_ACL_NUM                             10
#define RDABT_HCI_MAX_ACL_SIZE                            1536
#define RDABT_HCI_MAX_SCO_NUM                             10
#define RDABT_HCI_MAX_SCO_SIZE                            60

/****************** L2CAP ****************/
#define L2CAP_PRESENT                       1 
/* L2CAP */
#define RDABT_L2CAP_AUTO_CONFIG             1

#define L2CAP_GROUPS_SUPPORTED              0
#define L2CAP_CLS_TRAFFIC_SUPPORTED         0
#define L2CAP_PING_SUPPORTED                1
#define L2CAP_INFO_SUPPORTED                1
#define L2CAP_AGGREGATE_QOS                 0 
#define L2CAP_CONFIG_VALUES_BELOW_HCI       1
#define RETRANSMISSION_AND_FLOW_SUPPORT 	0
#define EXTENDED_FLOW_SPECIFICATION_SUPPORT 0
#define L2CAP_FCS_OPTION 	                0
#define EXTENDED_WINDOW_SIZE_SUPPORT	    0
#define L2CAP_FRAGMENT_ACL_SUPPORT          0

#define RDABT_L2_MAX_NUM_CHANNEL_IDENTIFIERS  0x03
#define RDABT_L2_MAX_NUM_LINKS                0x02
#define RDABT_L2_MAX_ECHO_DATA_SIZE           0x100
#define RDABT_L2_MAX_CLS_MTU                  0x04ED
#define RDABT_L2_MAX_NUM_PSM                  10
#define RDABT_L2_MAX_GROUPS                   10

#define RDABT_L2_MAX_IN_MTU         (60)
#define RDABT_L2_MAX_OUT_MTU         (60)

/* If 0, send connectionless traffic as ACTIVE broadcast, if 1 use PICONET broadcast */
#define L2CAP_USE_PICONET_BROADCAST         0 
/* handle used for broadcast acl data send */
#define L2CAP_BROADCAST_HANDLE                  (0xef1)

#define L2CAP_RETRANS_SUPPORT                   0

/******************** SDP *****************/
/* SDP - Server */
#define SDP_SERVER                          1
#define SDP_RECORD_GEN                      0
#define SDP_ROM_SUPPORT                     1
#define SDP_ROM_CREATION                    0

/* SDP - Client */
#define SDP_CLIENT                          1
#define SDP_SS_AND_SA_SUPPORT               0
#define SDP_SSA_SUPPORT                     1
#define SDP_GENERIC_BROWSE                  0
#define SDP_SDAP                            0
#define SDP_INTERFACE                       0
#define SDP_DB_TO_FILE                      0

/******************** OBEX ***************/
#define OBEX_PRESENT                        0 /* leave at 0 until obex supports new startup/shutdown code -MM */
#define OBEX_SERVER                         0
#define OBEX_CLIENT                         0
#define OBEX_SERIAL                         0
#define OBEX_SOCKET                         0
#define OBEX_RFCOMM                         0

#define OBEX_GENERIC                        0
#define OBEX_SEC                            0

/******************* RFCOMM ***************/
#define RFCOMM_PRESENT                        1
#define RDABT_RFCOMM_SM2                      1 /* enable RFCOMM service-level security handling */

#define RDABT_RFCOMM_RSE_SUPPORT              1
#define RDABT_RFCOMM_PE_SUPPORT               0

#define RDABT_RFCOMM_INCOMING_SM3             0

#define RDABT_RFCOMM_INITIAL_CREDITS          7
#define RDABT_RFCOMM_MAX_CREDITS              255
#define RDABT_RFCOMM_CREDIT_MIN               3
#define RDABT_RFCOMM_CREDIT_ISSUE             7

#define RDABT_RFCOMM_MAX_FRAME_SIZE           55 // for headset 329 for ftp cuijian changed it.
#define RDABT_RFCOMM_MAX_Connect_Port         5

/* define for the RSE Data Pump functionality */
#define RDABT_RFCOMM_RSE_DATA_PUMP_ENABLE     0
/******************** TCS  *****************/
#define TCSBIN_PRESENT                      0 /* leave at 0 until tcs supports new startup/shutdown code -MM */
#define RDABT_TCI_TCS_BIN                     0

#define RDABT_TCS_GATEWAY		                0
#define RDABT_TCS_TERMINAL	                0
#define RDABT_TCS_SINGLEPOINTCONFIGURATION	0
#define RDABT_TCS_ENABLEGATEWAYINTERCOMCALLS	0
#define RDABT_TCS_MULTIPICONETCAPABLE         0

/******************** AMP  *****************/
#define AMP_MANAGER_SUPPORT                 0

#define PAL_IN_HOST                         0

/******************************************* Profiles ****************************************************/
/* HSP profile */
#define HSP_PRESENT                         1
#define HSP_AG                              0
#define HSP_HS                              1

#define USING_HS_IN_HFP             1

/* HFP profile */
#define HFP_PRESENT                         1
#define HFP_AG                              0
#define HFP_HF                              1
#define HFP_FEATURES                       (0x18)  // hf use (0x18)   

/* A2DP profile */
#define A2DP_PRESENT                        0
#define A2DP_SRC                            0
#define A2DP_SNK                            0
#define HEADSET_PRESENT                     0

/* AVRCP profile */
#define AVRCP_PRESENT                       0 
#define AVRCP_TG                            0
#define AVRCP_CT                            0

/* Opp & SYNC & FTP  & PBAP*/
#define OBEX_PUSH_CLIENT                    0
#define OBEX_PUSH_SERVER                    0

#define OBEX_SYNC_CLIENT                    0
#define OBEX_SYNC_SERVER                    0

#define OBEX_FTP_CLIENT                     0
#define OBEX_FTP_SERVER                     0

#define OBEX_PBAP_CLIENT                    0
#define OBEX_PBAP_SERVER                    0

/* HID */
#define HID_PRESENT                         1
#define HID_HOST                            0
#define HID_DEVICE                          1
#define HID_MOUSE                           1
#define HID_KEYBOARD                        1
#define HID_WII                             1

/* DUN */
#define DUN_PRESENT                         0

/* SPP */
#define SPP_PRESENT                         1

/******************************************* Test and Debug ****************************************************/
/* test configure define */
/* Includes support for the host to act as a lower tester for conformance testing */
#define HOST_LOWER_TESTER                   0

/* RDABT_HOST_TCI_ENABLE Controls whether TCI component in enabled or not  */
#define RDABT_HOST_TCI_ENABLE                 0

/* Control whether host is unit test mode */
#define RDABT_HOST_UNIT_TEST                  0

/* Debug option */
#define pDEBUG                              0

#if pDEBUG
#define pDEBUGLEVEL                         pLOGNOTICE
#define pDEBUGLAYERS                        pLOGALWAYS
#endif

/*************************************** platform sepcific defines ************************************************/
/* Enable building of the DLL export table, and use the right calling convention */
#ifndef APIDECL1
#    define APIDECL1 
#else
/*#    pragma message ("Note: platform_config.h: APIDECL1 already defined (OK if not building DLL)")*/
#endif
#ifndef APIDECL2
#    define APIDECL2 
#else
/*#    pragma message ("Warning: platform_config.h: APIDECL2 already defined")*/
#endif

/* A unique platform-specific string */
#define PLATFORMSTRING "ARMCC"

/* define endian of platform */
#define BTHOST_BIGENDIAN                    0

#define COMBINED_HOST 1

#endif /* PLATFORM_CONFIG_H */

